package com.qinbaokeji.checkpoint.dahuacamera.service;


import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.stereotype.Component;

@Component
public class ServiceProcessor implements BeanPostProcessor {

    @Autowired
    private ILogInfoService iLogInfoService;
    @Autowired
    private ICameraInfoService iCameraInfoService;

    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        ServiceFactory.setService("iLogInfoService",iLogInfoService);
        ServiceFactory.setService("iCameraInfoService",iCameraInfoService);
        return bean;
    }
}
